package net.framework.smc.kotlin.demokotlin.dao

import net.framework.smc.kotlin.demokotlin.po.TripPo
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.JpaSpecificationExecutor
import org.springframework.data.jpa.repository.Query

/**
 *  @authore zyx
 *  @date 2018/7/5 16:46
 */
interface TripRepository : JpaRepository<TripPo, String>, JpaSpecificationExecutor<TripPo>{

    @Query(value = "from TripPo where owner=?1 and status=?2 and startTime between ?3 and ?4")
    fun findByStatus(userId : String, status: Int? = 0, start : String, end : String) : List<TripPo>
}



